from django.contrib import admin
from django.urls import path, include, re_path
from rest_framework.routers import SimpleRouter, DefaultRouter

from . import views
# 创建一个管理对象

# trailing_slash 是否要在 生成的路由尾部 添加 '/'
# router = SimpleRouter(trailing_slash=False)


# 注册视图集
router = DefaultRouter()
# 视图集路由：/task/ 和 /task/<pk>/
router.register(r'', views.TaskViewSet, basename='task')

urlpatterns = [
    # 包含视图集路由
    path('', include(router.urls)),
]